<template>

  <div>
    <FilterTable
        height="auto"
        selectionType="single"
        ref="table"
        :isSelectColumn="false"
        :columns="columns"
        :params="fetchParams"
        :fetchapi="fetchapi"
        :datakey="'records'"
        :isPagination = false
        :onColumnsChange="columns => (this.columns = columns)"

    >
    </FilterTable>
    <div class="pdi-foot">
      <el-button size="small" type="primary" @click="closeDialog">返回</el-button>
    </div>
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { getSchedule }from '@/api/repair/chongDianZhuang';


export default {
  components: {},
  mixins: [dictionary],
  props: {
    rowData: {
      //Object,就是重父页面取得值放在这里面了
      type: Object
    },
    vinNo: {
      type: String,
      default: ''
    },
    dealerCode: {
      type: String,
      default: ''
    },

  },
  created() {
    console.log('rowData',this.rowData.soNo)
    this.fetchParams = {'xsddhm': this.rowData.soNo}
    console.log("88888888888888888888888",this.fetchParams)


  },
  data() {
    return {
      // selectedRows: [], // 选中项
      columns: this.createTableColumns(),
      fetchapi: getSchedule, // 接口
      fetchParams: { xhrAbort: false },
      syncTableData: [], // 同步的table数据
      isCheck:false,
      isval:true,
    };
  },

  mounted() {
    console.log('dealerCode', this.dealerCode);

  },

  methods: {

    closeDialog() {
      console.log("走没走进这个方法")
      this.$emit('close', false);
    },


    createTableColumns() {
      return [

        {
          title: '工单号',
          dataIndex: 'workNo',
          width: 180,
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '工单状态',
          dataIndex: 'workStatus',
          sorter: true,
          filter: true,
          editItems: this.createDictList(3049),
          render: props => {
            return <span>{this.createDictText(props.row.workStatus, '3049')}</span>;
          },
          filterType: 'input'
        },
        {
          title: '安装进度',
          dataIndex: 'speedPro',
          sorter: true,
          filter: true,
          filterType: 'input'
        },

        {
          title: '更新人',
          dataIndex: 'updatedMan',
          sorter: true,
          filter: true,
          filterType: 'input'
        },

        {
          title: '更新时间',
          dataIndex: 'updatedTime',
          sorter: true,
          filter: true,
          filterType: 'input',
          dateFormat: 'yyyy-MM-dd HH:mm:ss'
        },

      ];
    },



    // 同步table数据
    handleSyncTableData(list) {
      this.syncTableData = list;
    },

    // 点击取消
    handleCancel() {
      this.$emit('save');
    },




  }
};
</script>
